from datetime import datetime
f = open ("input","r")
o = open ("output","w")

o.write (f.readline ())
first_point = f.readline ().split (",")
date = datetime.strptime (first_point[0], "%Y-%m-%d")
week_day = 0
running_total = float (first_point[1])
for line in f:
	point = line.split (",")
	week_day += 1
	running_total += float(point[1])
	if week_day > 6:
		newline = point[0] + "," + str(running_total).zfill(7)
		o.write (newline + "\n")
		running_total = 0
		week_day = 0
f.close ()
o.close ()	
